import request from '@/utils/request'
import type { SysUser, PageQuery, PageResult } from '@/types/user'

// 获取用户列表
export function getUserList(params: { 
  data: Partial<SysUser>, 
  params: PageQuery 
}) {
  return request<any, { code: number, msg: string, data: PageResult<SysUser> }>({
    url: '/system/user/list',
    method: 'post',
    data: params.data,
    params: params.params
  })
}

// 新增用户
export function addUser(data: Partial<SysUser>) {
  return request<any, { code: number, msg: string }>({
    url: '/system/user/add',
    method: 'post',
    data
  })
}

// 修改用户
export function updateUser(data: Partial<SysUser>) {
  return request<any, { code: number, msg: string }>({
    url: '/system/user/update',
    method: 'put',
    data
  })
}

// 删除用户
export function deleteUsers(ids: string[]) {
  return request<any, { code: number, msg: string }>({
    url: '/system/user/delete',
    method: 'post',
    data: ids
  })
} 